﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.Entity;

namespace ORMapperOef
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
    
    class Artist
    {
        public int ArtistId { get; set; }
        public string Name { get; set; }

        public virtual List<Album> Albums { get; set; }

        public override string ToString()
        {
            return Name;
        }
    }
    class Album
    {
        public int AlbumId { get; set; }
        public string Name { get; set; }
        public virtual List<Genre> Genres { get; set; }
        public virtual List<Track> Tracks { get; set; }

        public int ArtistId { get; set; }
        public virtual Artist Artist { get; set; }

        public override string ToString()
        {
            return Name;
        }
    }

    class Track
    {
        public int TrackId { get; set; }
        public string Name { get; set; }

        public int AlbumId { get; set; }
        public virtual Album Album { get; set; }

        public override string ToString()
        {
            return Name;
        }
    }

    class Genre
    {
        public int GenreId { get; set; }
        public string Name { get; set; }

        public int AlbumId { get; set; }
        public virtual Album Album { get; set; }

        public override string ToString()
        {
            return Name;
        }
    }

    class DomainContext : DbContext
    {
        public DbSet<Album> Albums { get; set; }
        public DbSet<Artist> Artists { get; set; }
        public DbSet<Genre> Genres { get; set; }
        public DbSet<Track> Tracks { get; set; }
    }
}
